package b3.widget.tab
{
	import flash.display.Sprite;
	import flash.text.TextField;

	public class TabPage extends Sprite
	{
		public var itemNum:int;
		private var wNum:int;
		private var hNum:int; 
		private var gap:int;
		
		public function TabPage(wNum:int = 5, hNum:int = 3, gap:int = 5)
		{
			super();
			this.wNum = wNum;
			this.hNum = hNum;
			this.gap = gap;
			itemNum = 0;
		}
		
		public function addItem(item:Sprite, width:int, height:int):void
		{
			item.x = (itemNum % wNum) * (width + gap);
			item.y = Math.floor(itemNum / wNum) * (height + gap);
			addChild(item);
			itemNum++;
		}
	}
}